package com.netease.dylan.test1;

import java.lang.reflect.Field;

public class TestAnnotation {
	public static void main(String[] args) {
		Field[] fields = MyObject.class.getDeclaredFields();
		for (Field field : fields) {
			boolean hasAnnotation = field.isAnnotationPresent(MyAnnotation.class);
			if(hasAnnotation) {
				MyAnnotation annotation = field.getAnnotation(MyAnnotation.class);
				System.out.println(annotation.id() + "|" + annotation.expiry());
			}
		}
	}
}
